package com.dxysun.springboot.reslover;

import com.dxysun.springboot.dto.User;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.MethodParameter;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.ModelAndViewContainer;

@Configuration
public class ResponseBodyResolver implements HandlerMethodReturnValueHandler
{
	private static final Log logger = LogFactory.getLog(ResponseBodyResolver.class);

	@Override
	public boolean supportsReturnType(MethodParameter returnType)
	{
		return true;
	}

	@Override
	public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer,
			NativeWebRequest webRequest) throws Exception
	{
		logger.info("ResponseBodyResolver handleReturnValue:" + returnValue);

	}
}
